﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace theguineasyndrome
{
    public class LevelObjectSorter : IComparer<ILevelObject>
    {

        public int Compare(ILevelObject x, ILevelObject y)
        {
            int comp = (int)(y.Depth - x.Depth);

            if (comp == 0)
                comp = x.GetHashCode() - y.GetHashCode();

            return comp;
        }

    }
}
